//
//  WFButtonView.swift
//  GZWeibo666
//
//  Created by 刘文锋 on 15/12/1.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

class WFButtonView: UIView {
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        prepareUI()
    }
    // MARK: - 准备UI
    func prepareUI()
    {
        // 添加子控件
        addSubview(commnet)
        addSubview(number)
        //添加约束
        /// 顶部控件, 在contentView内部,左上没有偏移

        commnet.ff_AlignInner(type: ff_AlignType.CenterLeft, referView: self, size: CGSize(width: 30, height: 40), offset: CGPoint(x: 10, y: 2))
        number.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commnet, size: CGSize(width: 35, height: 40), offset: CGPoint(x: 5, y: 2))

        
    }
    
    // MARK: - 懒加载 评论
    private lazy var commnet : UIButton =
    {
        let but = UIButton()
        but.titleLabel?.text = "评论"
        but.sizeToFit()
        but.titleLabel?.font = UIFont.systemFontOfSize(14)
        but.tintColor = UIColor.orangeColor()
        return but
        }()
    private lazy var number : UILabel =
    {
        let label = UILabel(color: UIColor.purpleColor(), fontSize: 14)
        label.text = "0"
        return label
        }()
}
